// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Sort.java

package com.hdy.func.Sort;

import com.hdy.func.Lost.Lost;
import java.util.Date;

public class Sort
{

    public Sort()
    {
    }

    public static Lost[] sortLost(Lost lost[])
    {
        merge(0, lost.length - 1, lost);
        return lost;
    }

    private static void merge(int low, int high, Lost lost[])
    {
        int mid = (low + high) / 2;
        if(low < high)
        {
            merge(low, mid, lost);
            merge(mid + 1, high, lost);
            mergeSort(low, mid, high, lost);
        }
    }

    private static void mergeSort(int low, int mid, int high, Lost lost[])
    {
        Lost temp[] = new Lost[high + 1];
        int i = low;
        int j = mid + 1;
        int k = 0;
        while(i <= mid && j <= high) 
            if(lost[i].getDate().getTime() <= lost[j].getDate().getTime())
                temp[k++] = lost[i++];
            else
                temp[k++] = lost[j++];
        while(i <= mid) 
            temp[k++] = lost[i++];
        while(j <= high) 
            temp[k++] = lost[j++];
        for(int z = 0; z < k; z++)
            lost[low + z] = temp[z];

    }
}
